package com.cn.lp.openapi.base;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * 有FeignClient注解的Mapping不做为Controller
 * 引入servlet包才不会报红，不影响使用
 */
public class FeignRequestMappingHandlerMapping extends RequestMappingHandlerMapping {

    @Override
    protected boolean isHandler(Class<?> beanType) {
        return super.isHandler(beanType) &&
            !AnnotatedElementUtils.hasAnnotation(beanType, FeignClient.class);
    }

}